<template>
    <div>
        <van-list
                v-model="config.loading"
                :finished="config.finished"
                finished-text="没有更多了"
                @load="takes"
                :immediate-check="false"
        >
            <div class="mt10">
                <div class="flex-row justify-content-between align-items-center pd-12-16 border-bottom"
                     v-for="(item,index) in list" :key="index">
                    <div class="flex-column">
                        <van-tag v-if="item.state==1" type="primary" plain style="width: fit-content">
                            {{item.state_name}}
                        </van-tag>
                        <van-tag v-if="item.state==2" type="success" plain style="width: fit-content">
                            {{item.state_name}}
                        </van-tag>
                        <van-tag v-if="item.state==3" type="default" plain style="width: fit-content">
                            {{item.state_name}}
                        </van-tag>
                        <div class="mt5">姓名：<span class="">{{item.name}}</span></div>
                        <div class="mt5">支付宝账号：<span>{{item.mobile}}</span></div>
                    </div>
                    <div class="font-weight font-16">
                        ¥{{item.money}}
                    </div>
                </div>
            </div>
        </van-list>
    </div>
</template>
<script>
    export default {
        name: "Takes",
        data() {
            return {
                list: [],
                active: 0,
                url: {
                    takes: this.axiosUrl + 'money/takes'
                },
                config: {
                    loading: false,
                    finished: false,
                    pageIndex: 1,
                    limit: 10,
                }
            }
        },
        components: {},
        mounted() {
            this.takes()
            this.$wxConfig.share(this.$route.path)

        },
        methods: {
            takes() {
                let _this = this
                _this.config.loading = true
                _this.$http.post(_this.url.takes, {
                    pages: _this.config.pageIndex,
                    limit: _this.config.limit
                }, (res) => {
                    _this.list = _this.list.concat(res)
                    _this.config.pageIndex++
                    if (res.length < _this.config.limit) {
                        _this.config.finished = true
                    } else {
                        _this.config.finished = false
                    }
                    _this.config.loading = false
                })
            }
        }
    }
</script>
<style lang="stylus" scoped>
    .van-tabs__line {
        background-color #ff6f00
    }

    .mine-list
        margin 16px
        background white
        border-radius 8px
        overflow hidden

    .money-main {
        height 250px
        background #666
    }
</style>
